<template>
  <view>
    <view class="topView" @touchmove.stop.prevent catchtouchmove="true">
      <view class="container" v-if="taskStatus==1">
        <view class="close" @click="closeDialog('关闭')">×</view>
        <view class="text" style="padding: 0;text-align: center;">本轮助力已完成，期待您的下次参与</view>
        <view class="checkBtnBox">
          <view class="btn submit" @click="closeDialog('我知道了')">我知道了</view>
        </view>
      </view>
      <view class="container" v-if="taskStatus==2">
        <view class="close" @click="closeDialog('关闭')">×</view>
        <view class="text">
          恭喜您助力成功，探索店铺发现更多麦卡伦风味佳酿
        </view>
        <view class="checkBtnBox">
          <view class="btn submit" @click="closeDialog('我知道了')">我知道了</view>
        </view>
      </view>
      <view class="container" v-if="taskStatus==3">
        <view class="close" @click="closeDialog('关闭')">×</view>
        <view class="text" style="padding: 0 40rpx 0 48rpx;">为好友助力获得麦卡伦“不凡甄选” 活动参与机会</view>
        <view class="checkBtnBox">
          <view class="btn submit" @click="doHelp">立即助力</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {}
    },
    props: {

      taskStatus: {
        typeof: Number,
      }
    },

    methods: {

      closeDialog(type) {
        this.$emit('closeDialog')
        this.$commonSensors.popupEvent('PopupClick', {'popup_type' : '抽签任务', 'popup_name': this.taskStatus == 1 ? '助力已完成弹窗' : this.taskStatus == 2 ? '助力成功弹窗' : '助力弹窗', 'button_name': type})
      },
      doHelp() {
        this.$emit('doHelp')
        this.$commonSensors.popupEvent('PopupClick', {'popup_type' : '抽签任务', 'popup_name': '助力弹窗', 'button_name': '立即助力'})
      }
    }
  }
</script>

<style lang="scss">
  .topView {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background-color: rgba(0, 0, 0, 0.52);

    .container {
      box-shadow: 0px 0px 6px 2px #333;
      position: absolute;
      top: 40%;
      width: 520rpx;
      background: #fff;
      margin: auto;
      left: 0;
      right: 0;

      .close {
        position: absolute;
        width: 50rpx;
        height: 50rpx;
        top: 10rpx;
        right: 6rpx;
        line-height: 40rpx;
        font-size: 48rpx;
        text-align: center;
      }

      .text-left {
        margin-left: 48rpx;
        text-align: left;
        font-size: 28rpx;
      }

      .text {
        font-size: 28rpx;
        line-height: 45rpx;
        padding: 0 45rpx 0 48rpx;
        text-align: justify;
        margin: 80rpx auto 56rpx;

      }

      .checkBtnBox {
        margin: 0 48rpx;
        padding-bottom: 50rpx;
        display: flex;
        justify-content: center;

        .btn {
          width: 196rpx;
          height: 68rpx;
          border: 1px solid #333;
          background: #fff;
          color: #000;

          &.submit {
            display: flex;
            justify-content: center;
            align-items: center;
            color: #fff;
            background: #000;
          }
        }
      }
    }
  }
</style>
